//
//  networkDefine.m
//  ChatRoom
//
//  Created by lee han on 12/10/12.
//  Copyright (c) 2012 lee han. All rights reserved.
//

#import "networkDefine.h"

struct StructMessage
{
    NSInteger type;
    NSString* function;
};

StructMessage g_NetworMessage[NetworkFunctionType_Count] =
{
    {NetworkFunctionType_Login,                 @"Login/login"},
    {NetworkFunctionType_Logout,                @"Login/logout"},
    {NetworkFunctionType_Signup,                @"Login/signup"},
    {NetworkFunctionType_ModifyPassword,        @"Login/modifypwd"},
    
    {NetworkFunctionType_AddressList,           @"Address/addresslist"},
    {NetworkFunctionType_AddAddress,            @"Address/addaddress"},
    {NetworkFunctionType_ModifyAddress,         @"Address/modifyaddress"},
    {NetworkFunctionType_DelAddress,            @"Address/deladdress"},
    
    {NetworkFunctionType_CategoryList,          @"Category/categorylist"},
    
    {NetworkFunctionType_ProductList,          @"Product/productlist"}, //10
    {NetworkFunctionType_ProductInfo,          @"Product/productinfo"},
    
    {NetworkFunctionType_AddShopCar,          @"Product/addtoshopcar"},
    {NetworkFunctionType_BurstSectionList,      @"Product/burstsectionlist"},
    {NetworkFunctionType_Collect,              @"Product/collect"},
    {NetworkFunctionType_CancenCollect,          @"Product/cancelcollect"},
    {NetworkFunctionType_DeleteFromShopCar,          @"Product/deletefromshopcar"},
    {NetworkFunctionType_search,                @"Product/searchlist"},
    {NetworkFunctionType_cellection,         @"Product/collectlist"},
    {NetworkFunctionType_ShopcarList,           @"Shopcar/shopcarlist"},
    {NetworkFunctionType_SaleList,              @"Product/salelist"},  //20
    
    {NetworkFunctionType_AddressSelect,         @"Address/selectaddress"},
    
    {NetworkFunctionType_CreateOrder,           @"Order/createorder"},
    {NetworkFunctionType_OrderList,           @"Order/orderlist"},
    {NetworkFunctionType_OrderDetail,      @"Order/orderdetail"},
    {NetworkFunctionType_OrderReceive,      @"Order/orderreceive"},
    {NetworkFunctionType_OrderRebuy,        @"Order/orderrebuy"},
    
    {NetworkFunctionType_Complain,          @"Login/complain"},
    
    {NetworkFunctionType_ProductDetail,     @"Product/productdetail"},
    
    {NetworkFunctionType_ExpDetail,         @"Login/expdetail"},
    
    {NetworkFunctionType_GetVerifyCode,     @"Login/getverifycode"} //30
};

NSString* getFunctionName(NSInteger type)
{
    for (NSInteger i = 0; i < NetworkFunctionType_Count; ++i)
    {
        if (g_NetworMessage[i].type == type)
        {
            return g_NetworMessage[i].function;
        }
    }
    
    return nil;
}
